import 'package:flutter_cwhisky/pages/main/classify/classify_view.dart';
import 'package:get/get.dart';

import '../../routes/app_pages.dart';
import '../main/cart/cart_view.dart';
import '../main/found/found_view.dart';
import '../main/home/home_view.dart';
import '../main/message/message_view.dart';
import '../main/mine/mine_view.dart';
import '../main/trends/trends_view.dart';


class IndexLogic extends GetxController {
  final page = [HomePage(), ClassifyPage(), TrendsPage(), CartPage(), MinePage()];
  int index = 0;

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    super.onClose();
  }

  changeBottomBarIndex(int index) {
    if (index == 2) {
      Get.toNamed(
        Routes.publish,
      );
    } else {
      if (this.index != index && index != 2) {
        this.index = index;
        update();
      }
    }
  }
}
